import { SPetInfo } from "../../../../../Message/Game/SPetInfo";
import { ColorInfo } from "../../../resource/info/ColorInfo";
import { ColorConfig } from "../../../resource/ColorConfig";
import { Language } from "../../../../../extend/language/Language";
import { PetConfig } from "../../../resource/PetConfig";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
type int = number;
//class PetColor
    
    export  class PetColor
    {
        

        public static getTalentColor(arg1: SPetInfo): ColorInfo
        {
            var loc1=ColorConfig.instance.getItemColor(1);
            var loc2=arg1.talent;
            if (arg1) 
            {
                loc1 = PetColor.getTalentColorByTalent(arg1.gene, arg1.talent);
            }
            return loc1;
        }

        public static getColorName(arg1: SPetInfo): string
        {
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc1="";
            var loc2="";
            if (arg1) 
            {
                loc5 = PetColor.getTalentColor(arg1);
                if (arg1.gene != 1) 
                {
                    if (arg1.gene == 2) 
                    {
                        loc2 = Language.getString(54095);
                    }
                }
                else 
                {
                    loc2 = Language.getString(54094);
                }
                if ((loc3 = arg1.typeName) == "" || loc3 == null) 
                {
                    if (loc4 = PetConfig.instance.getInfoByCode(arg1.code)) 
                    {
                        loc3 = loc4.name;
                    }
                }
                loc1 = HTMLUtil.addColor(loc2 + loc3, loc5.color);
            }
            return loc1;
        }

        public static getTalentColorByTalent(arg1: int, arg2: int): ColorInfo
        {
            var loc1=ColorConfig.instance.getItemColor(1);
            if (arg2 >= 401 && arg2 <= 600) 
            {
                loc1 = ColorConfig.instance.getItemColor(2);
            }
            else if (arg2 >= 601 && arg2 <= 800) 
            {
                loc1 = ColorConfig.instance.getItemColor(3);
            }
            else if (arg2 >= 801 && arg2 <= 1000) 
            {
                loc1 = ColorConfig.instance.getItemColor(4);
            }
            else if (arg2 >= 1001 && arg2 < 2000) 
            {
                loc1 = ColorConfig.instance.getItemColor(5);
            }
            else if (arg2 >= 2000) 
            {
                loc1 = ColorConfig.instance.getItemColor(6);
            }
            return loc1;
        }

        public static isAbovePurple(arg1: int): Boolean
        {
            return arg1 >= 801;
        }

        public static getColorTalent(arg1: int): string
        {
            return HTMLUtil.addColor(arg1.toString(), PetColor.getTalentColorByTalent(1, arg1).color);
        }
    }
